Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util/chunk: optimize (*ListInDisk).GetChunk and add a fast row container reader (#45130) #45204

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #45130

What problem does this PR solve?

Issue Number: close #45125

Problem Summary:

The existing reading method of RowContainer (GetChunk(...)) is not fast enough for dumping a lot of rows from disk (for the cursorFetch use case).

The existing Iterator4RowContainer is even slower, as it allocates a new chunk for each row 🤦.

This PR is extracted from #44730 (with a some refractor).

What is changed and how it works?

This PR pipelines the IO and CPU calculation, to make full use of the IO bandwidth. It should also help other features using rowContainer, as GetChunk is now much faster.

The performance of existing benchmark BenchmarkListInDisk_GetChunk increases from 2877471ns/op to 462864ns/op

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR. labels Jul 6, 2023
@ti-chi-bot ti-chi-bot bot added do-not-merge/cherry-pick-not-approved do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 6, 2023
@YangKeao YangKeao requested review from xhebox and wshwsh12 July 10, 2023 05:52
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 10, 2023
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Jul 24, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wshwsh12, xhebox

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 25, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 25, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-07-10 06:05:48.820998859 +0000 UTC m=+312040.591337573: ☑️ agreed by xhebox.
  • 2023-07-25 07:57:55.74406744 +0000 UTC m=+254818.338598426: ☑️ agreed by wshwsh12.

@hawkingrei
Copy link
Member

/retest

1 similar comment
@YangKeao
Copy link
Member

/retest

@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

❗ No coverage uploaded for pull request base (release-6.5@09da01c). Click here to learn what that means.
The diff coverage is n/a.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-6.5     #45204   +/-   ##
================================================
  Coverage               ?   73.6739%           
================================================
  Files                  ?       1081           
  Lines                  ?     346737           
  Branches               ?          0           
================================================
  Hits                   ?     255455           
  Misses                 ?      74871           
  Partials               ?      16411           

@YangKeao
Copy link
Member

/retest

@ti-chi-bot ti-chi-bot bot merged commit a431496 into pingcap:release-6.5 Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants